# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html.
# For more examples on how to use CMake, see https://github.com/android/ndk-samples.

# Sets the minimum CMake version required for this project.
cmake_minimum_required(VERSION 3.22.1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")

include_directories(include
        util
        AV/render
        AV/render/audio
        AV/decode/video
        AV/Player
        AV
        AV/common

        AV/decode
        AV/decode/audio

)
message(" test ${CMAKE_SOURCE_DIR}")
message(" test ${CMAKE_ANDROID_ARCH_ABI}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/libs/${CMAKE_ANDROID_ARCH_ABI}")

project("tsavplayer")


file(GLOB src-files

        ${CMAKE_SOURCE_DIR}/AV/common/*.cpp
        ${CMAKE_SOURCE_DIR}/AV/decode/video/*.cpp
        ${CMAKE_SOURCE_DIR}/AV/decode/audio/*.cpp
        ${CMAKE_SOURCE_DIR}/AV/decode/*.cpp
        ${CMAKE_SOURCE_DIR}/AV/Player/*.cpp
        ${CMAKE_SOURCE_DIR}/AV/render/*.cpp
        ${CMAKE_SOURCE_DIR}/AV/render/audio/*.cpp
        ${CMAKE_SOURCE_DIR}/AV/*.cpp
        )
#//导入so
link_directories(${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI})
add_library(${CMAKE_PROJECT_NAME} SHARED
        ${src-files}
        native-lib.cpp)
find_package (oboe REQUIRED CONFIG)

target_link_libraries(${CMAKE_PROJECT_NAME}
        android
        avcodec
        avfilter
        oboe::oboe
        avformat
        avutil
        swresample
        swscale
        EGL
        mediandk
        GLESv3
        OpenSLES
        aaudio
        log)


